package com.zyy.demo.controller;

import com.zyy.demo.service.DemoService;
import com.zyy.mvcframework.annotation.MyAutowired;
import com.zyy.mvcframework.annotation.MyController;
import com.zyy.mvcframework.annotation.MyRequestMapping;
import com.zyy.mvcframework.annotation.MySecurity;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author zyy
 * @date 2020/12/8 10:23 下午
 * @description
 */
@MyController
@MyRequestMapping("/demo")
@MySecurity("zhangsan")
public class DemoController {

    @MyAutowired
    private DemoService demoService;

    @MySecurity({"lisi","wangwu"})
    @MyRequestMapping("/query")
    public void query(HttpServletRequest request, HttpServletResponse response,String name) throws IOException {
        String name1 = demoService.getName(name);
        response.getWriter().write(name);
    }

    @MyRequestMapping("/query02")
    public void query02(HttpServletRequest request, HttpServletResponse response,String name) throws IOException {
        String name1 = demoService.getName(name);
        response.getWriter().write(name);
    }
}
